package com.nes.rabbitmq.springboot.simple;

import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.messaging.handler.annotation.Payload;
import org.springframework.stereotype.Service;

/**
 * Created by wdq on 17-3-13.
 */
@Service
//注册队列的监听-指定队列名称
@RabbitListener(queues = "spring-queue-simple")
public class Receiver {

    //接收者
    @RabbitHandler
    public void receiveMessage( String message) {
        System.out.println("Received <" + message + ">");
    }
}
